<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <button @click="show = !show">切换</button>
      <div v-if="show">我是v-if</div>
      <div v-show="show">我是v-show</div>


      <!-- 如果有双分支、多分支，那得用v-if -->
      <div v-if="age >= 18">去网吧偷耳机</div>
      <div v-else>去公园捡垃圾</div>

      <!-- 多分支 -->
      <div v-if="money >= 5000">请我去按摩</div>
      <div v-else-if="money >= 3000">请我去洗脚</div>
      <div v-else-if="money >= 1000">请我去吃饭</div>
      <div v-else>钱太少，打他一顿回家取钱</div>

    </div>
    <script src="./vue.js"></script>
    <script>
      new Vue({
        el: '#app',
        data () {
          return {
            show: true,
            age: 14,
            money: 9999
          }
        },
        methods: {}
      })
    </script>
  </body>
</html>
